<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="/pages/protected/templates/master.xhtml">
		<ui:define name="divMain">
			<h3>
				#{bundle.funcRegistros}:
				<h:outputText value="#{funcionarioMB.funcComRegistros.nome}" />
			</h3>
			<h:form id="funcionariosForm">
				<p:dataTable id="funcionariosTable"
					value="#{funcionarioMB.funcComRegistros.registros}" var="registro"
					emptyMessage="#{bundle.noRecords}" paginator="true" rows="10"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,15">
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.numeroRegistro}" />
						</f:facet>

						<h:outputText value="#{registro.numero}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.dataRegistro}" />
						</f:facet>
						<h:outputText value="#{registro.dataHora}" >
							<f:convertDateTime pattern="dd/MM/yyyy" type="date" />
						</h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.horaRegistro}" />
						</f:facet>
						<h:outputText value="#{registro.dataHora}" >
							<f:convertDateTime pattern="HH:mm:ss" type="date" />
						</h:outputText>
					</p:column>
					<p:column>
						<p:commandButton value="#{bundle.remove}" icon="ui-icon-plus"
							actionListener="#{funcionarioMB.resetRegistro}"
							onclick="funcRemoverRegistroDialogWidget.show();"
							update=":funcRemoverRegistroDialogForm">
							<f:setPropertyActionListener target="#{funcionarioMB.registro}"
								value="#{registro}" />
						</p:commandButton>
						<p:spacer width="10px" />
					</p:column>

				</p:dataTable>
				<p:commandButton value="#{bundle.add}  #{bundle.registro}"
					icon="ui-icon-plus" onclick="funcAddRegistroDialogWidget.show();"
					update=":funcAddRegistroDialogForm" />
			</h:form>

			<ui:include
				src="/pages/protected/defaultUser/funcRegistros/dialogs/funcAddRegistroDialog.xhtml" />
			<ui:include
				src="/pages/protected/defaultUser/funcRegistros/dialogs/funcRemoverRegistroDialog.xhtml" />
		</ui:define>
	</ui:composition>
</h:body>
</html>